<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
		<script src="https://cdn.jsdelivr.net/npm/vue"></script>
		<title>事件监听器</title>
	</head>
	<body>
		<div id="app">
			<ol>
				<todo-item
					v-for='item in groceryList'
					v-bind:todo = 'item'
					v-bind:key = 'item.id'>
				</todo-item>
			</ol>
		</div>
	</body>
	<script>
		Vue.component('todo-item', {
			props: ['todo'],
			template: '<li>{{todo.text}}</li>'
		})
		var app = new Vue({
			el: '#app',
			data: {
				groceryList: [
					{id: 0, text: '面包'},
					{id: 1, text: '奶酪'},
					{id: 2, text: '可以吃的'}
				]
			}
		})
	</script>
</html>